Top 10k strings from Beyond Basic - Experimentor (1984)(Sinclair Research).tzx
in <root> / bin / z80 / software / Sinclair Spectrum Collection TOSEC.exe / Sinclair ZX Spectrum - Utilities & Educational / Sinclair ZX Spectrum - Utilities & Educational - [TZX] (TOSEC-v2007-01-01) /
Back to the directory listing
5 z$=o$(n2): 2 z$=o$(n2,n2 2 s$(a+l,n4)= 2 r$(a-m6);",";b; 2 o$(l)="HL " 2 abel or value not set": 2 Please press any key to continue 2 B<m0)+(B<m0));B: 2 ADDSUBCP JR JR JR 2 ;"LD A,(HL)" 2 ;"LD (HL),A": 2 ;" REGISTERS"; 2 (c-tt*(c>tt*n3)): 1 zx,zy;" ": 1 z$=o$(l,l): 1 x$(i);r$(i);" ";: 1 v(i)+l)+"Z": 1 v$="The value in each RAM storage box can be any number from" 1 v$(n7)=v$(a+l): 1 v$(n6)=v$( 1 v$(l-z)=v$(n7): 1 v$(-z)=v$(n6): 1 v$(-X)=v$(Y): 1 t$(nz)=t$(l): 1 t$(n7)=t$(a+l): 1 t$(n6)=t$(a): 1 t$(l-z)=t$(n7): 1 t$(-z)=t$(n6): 1 t$(-i)+N4) 1 t$(-X)=t$(y): 1 s$(y+l,n4)= 1 s$(y+l)=l$ 1 s$(i+l,n5) 1 s$(i+l,n4) 1 s$(i+l,n3) 1 s$(i+l,n2) 1 s$(c+l,n5)= 1 s$(b+l,n5)= 1 s$(b+l)=i$: 1 s$(NN,N5): 1 r,m6;">*"(m+l): 1 r$="ABCDEHLMNOPQRSTUVWXYF" 1 r$(A);",";r$(b-tt*A); 1 o;"Rewind and play back to verify.", 1 o;"Please enter store or register","name and value; e.g. M 6 or H ^Q": 1 o;"Please enter name of program.","If it fails, 1 o;" Please press a key as above.",,,: 1 o;" Please enter new instruction, ENTER to finish"+(", D to delete" 1 o;" Press any key to continue.",,, 1 o$(n2,n4): 1 o$(n2,l)="^" 1 o$(n2)="HL " 1 o$(n2)="(HL)" 1 o$(n2)=" " 1 o$(l)="Z " 1 o$(l)="(HL)" 1 o$(l)=" ": 1 nz;f$(a-n8*(a>m6));" ";: 1 n7,n3;"A set up a new program",,," J load a saved program",,, 1 n6,n3;"You can now create a program",,,"of your own design and run it",,,"to see the effect on the store",,,"and registers."; 1 n2,nz;"Program": 1 n2,n7;"Registers"; 1 n2,l;"Store"; 1 n$=" numbers " 1 m9,o;a$;" not understood",: 1 m8,o;"I insert","R run","C change", 1 m8,o,,,,a$;" checking...",,,: 1 m8,o,,,," Setting up - please wait.",,,: 1 m8,O;"R run","E edit","V set values",: 1 m)+n2*(e=i 1 m$=" Z80 microprocessor" 1 m 34 1 l$=" registers " 1 k$=" characters " 1 jd3=(jd1-1 1 j$=" storage " 1 instruction 1 i)+A;" " 1 h$=" store " 1 g$=" data " 1 f$=" instruction" 1 f$(jd1,jd2)=q$(jd3) 1 e+zs,f+zt;c$(zd) 1 d$="Load the value" 1 c$=d$+" held in A into the address held in registers HL.": 1 c$="The literal, op2 is loaded into register, op1": 1 c$="The PC register is incremented to point to the instruction labelled e.": 1 c$="Subtract the con-tents of register r from the contents of A. Store the result back in A.": 1 c$="Subtract the con-tents of register r from the contents of A. Set the flag register accordingly. A and r are left unchanged.": 1 c$="SUB E": 1 c$="Registers L & H are loaded with the values in store locations nn and nn+1.": 1 c$="NOTE:NZ(non-zero) and Z(zero) can both be used as conditions.": 1 c$="NOTE:NZ (non-zero) and Z (zero) can both be used as conditions." 1 c$="Load the literal nn ( usually an address ) into registers H & L.": 1 c$="Load the contentsof registers H & L (sometimes anaddress) into store location nn & nn+1.": 1 c$="Load the contentsof register r' into register r.": 1 c$="Load the contentsof register A into the location with address nn": 1 c$="Load register A with the contents of location nnin RAM": 1 c$="Load register A from the store locaton whose address is in H&L": 1 c$="LD HL,^M": 1 c$="LD HL,(M)": 1 c$="LD B,C": 1 c$="LD A,7": 1 c$="LD A,(M)": 1 c$="LD A,(HL)": 1 c$="LD (M),HL": 1 c$="LD (M),A": 1 c$="LD (HL),A": 1 c$="JR S": 1 c$="JR NZ,S": 1 c$="If the flag register is currently set the same as condition cc then set PCat the instruction labelled e. If not, continue .": 1 c$="CP E": 1 c$="Add the contents of the two register operands together and place the sum back into register A": 1 c$="ADD A,E": 1 b$="Two registers as a pair can holda value from": 1 b$="Such pairs are commonly used to hold the number or address of a storage box. They act like a pointer to the box.": 1 b$="Each register can hold a value from": 1 b$=" the value " 1 b$=" Within the Z80, RAM or ROM locations are accessed by means of their numeric address.": 1 b$=" We can move data from RAM into the processor " 1 b$=" We can move data from RAM into the Processor's registers": 1 b$=" The computer thinks of both characters and numbers as the contents of boxes." : 1 b$=" RAM store can be altered by loading data from the registers or store.": 1 b$=" It is left to a compiler or an assembler to connect our names with the numeric address.": 1 b$=" In Assembler or BASIC programs, it is easier for us to give a name to our data areas.": 1 b$=" Arithmetic operations can change data in the processor's registers": 1 and then obeys it." 1 a$="D " 1 a$=" given in operand ": 1 a$=" " 1 [add,subtract]"; 1 Z$=o$(n2): 1 We have just seen what is inside your Spectrum - STORE, REGISTERS, PROCESSOR etc."''" We have started to look at how you can manipulate data in a computer by using Assembly Language instructions." 1 S$(y+l)=L$ 1 S$(e+l,l)=s$(l,l): 1 S$(a+l,n4)= 1 Read Only Memory 1 Random Access Memory 1 NOTE:NZ (non-zero) and Z (zero) can both be used as conditions.D 1 N3)=S$(y+l, 1 Load the valueR 1 LD LD LD LD LD LD LD LD endX 1 LD LD LD LD LD LD LD LD end 1 K,m6;" *>"(b+l);: 1 I$(i-a+l)= 1 Created with Ramsoft MakeTZX 1 BEYOND 1 ARITHMETIC 1 AJCMI67RSVEH 1 ABCDEHLMNOPQRSTUVWXYF 1 ;'" C. LD r,nn D. LD r,r' E. LD A,(nn) F. LD (nn),A G. LD HL,nn H. LD (nn),HL I. LD HL,(nn) J. LD A,(HL) K. LD (HL),A L. ADD A,r M. SUB r N. JR e O. CP r P. JR cc,e"; 1 ;'" B. INTRODUCTORY IDEAS"; 1 ;"to hold large numbers,float-ing point numbers,strings etc )" 1 ;"form. Your Spectrum manual showsthe code number equivalent to each character." 1 ;"____________"; 1 ;"____ _____"; 1 ;"YOUR program is encoded and held in RAM itself and is effectively data acted upon by a compiler or interpreter and the Z80 chip." 1 ;"When the PC is changed, it is usually made to point to the following instruction . But someinstructions change the PC quite drastically." 1 ;"Welcome to"; 1 ;"We can perform on registers more than the simple reads and writes that are possible on RAM." 1 ;"These extra operations are:"; 1 ;"There are a number of Registers of which we will consider 7. They are called by the letters"; 1 ;"The";m$;" performs very simple instructions. Many of these may be needed to obey just a single BASIC command." 1 ;"The value in each storage box can be any number from" 1 ;"The program counter register ( or PC ) points to the next instruction to be executed." 1 ;"The initial screens explain how certain points are represented in this program to avoid your having to learn too many detailsabout the workings of micros." 1 ;"The following screens describe individually a subset of Z80 Assembler instructions."; 1 ;"THE FLAG REGISTER"; 1 ;"Such instructions are:"''" - jumps (Basic GOTOs)"''" - subroutine calls (GOSUBS)"''" - conditional jumps (IF..THEN)" 1 ;"Registers are a set of special storage boxes inside the CPU." 1 ;"REGISTERS": 1 ;"PROGRAM": 1 ;"PROG COUNTER"; 1 ;"PC points to"'" the next"'" instruction" 1 ;"LOAD O in A"; 1 ;"LOAD A in Q"; 1 ;"LD r,r'": 1 ;"LD r,nn": 1 ;"LD HL,nn" 1 ;"LD HL,(nn)" 1 ;"LD HL,(M)" 1 ;"LD B,C": 1 ;"LD A,(nn)" 1 ;"LD A,(M)": 1 ;"LD (nn),HL" 1 ;"LD (nn),A" 1 ;"LD (M),HL": 1 ;"LD (M),A": 1 ;"L LOAD N in C"; 1 ;"JR cc,e": 1 ;"JR NZ,S": 1 ;"Instructions cause the movement of";n$;"and";k$; 1 ;"Inside the ZX Spectrum is a";m$;" commonly called a 1 ;"INSTRUCTIONS"; 1 ;"INSTRUCTION:"'"DESCRIPTION:"'''''"EXAMPLE: ": 1 ;"Flag reg. is set": 1 ;"Flag reg. is set" 1 ;"FUNCTION OPERAND 1 OPERAND 2" 1 ;"FLAG REGISTER"; 1 ;"FLAG REGISTER" 1 ;"Each screen shows the format of a particular instruction, a description of its effect in thecomputer and a working example." 1 ;"BEYOND BASIC"; 1 ;"An instruction is made up of:"; 1 ;"ADDRESS NAME" 1 ;"ADD A,r" 1 ;"ADD A,E": 1 ;"A character is held in coded" 1 ;"A B C D E H L" 1 ;"24-11=Non zero"; 1 ;"0 to 255 " 1 ;"- a FUNCTION"'" the action to perform"; 1 ;"- OPERANDS"'" which boxes or registers to perform the action on" 1 ;"(BC)"''"The words OP1 and OP2 will be used for general operands from now.": 1 ;"( NOTE : The BASIC interpreter in ROM enables several small boxes to be thought of as a big box"; 1 ;" YOU CAN RE-ENTER THE PROGRAM, IF YOU WISH, WITH"''" GOTO 9940 ENTER"; 1 ;" THE INSTRUCTION FORMAT"; 1 ;" STORE, REGISTERS "; 1 ;" RAM and ROM store"; 1 ;" RAM and ROM store" 1 ;" RAM STORAGE"; 1 ;" Press a letter (A to P)"'" then ENTER."; 1 ;" PROGRAM COUNTER REGISTER"; 1 ;" INTRODUCTION TO "; 1 ;" AND ASSEMBLER. "; 1 ;" A. ALL THE FOLLOWING OPTIONS"; 1 ;" 0 to 255 " 1 ;" ASSEMBLER COMMAND TUTOR."''" You may have all of the Z80 subset described to you or any particular command."''" Please indicate your choice."'' 1 ;" 0 to 65535 - ie 64K " 1 .The CPU reads an 1 . Store & Register overview"''" 1 . Return to BASIC"; 1 . Create & run your program"''" 1 . Assembler commands tutor"''" 1 )="AJCMI67RSVEH" 1 );"in the Spectrum"; 1 ).They can also cause";g$;"to be changed." 1 ),e;b$(lq) 1 (ROM)"''" - 1 (RAM)"''" - 1 '''"r or r' will be used if the operand is any register"''"lit will be used if the operand is a literal ( ie a number from 0 to 255 )"''"e is used to label an instruction (rather like a line number in BASIC)" 1 '''" Your SPECTRUM contains within it a number of storage chips."''" All machines have a 16K ROM. This contains the operating system written by Sinclair."''" This is simply a program that looks after the inputting and running of your BASIC programs and other aspects of overall control."''" You cannot change it, not even by switching the power off!" 1 '''" This program is designed to help you understand some of the basic ideas concerning the workings of your SPECTRUM microcomputer."''''" It does this by a mixture of illustrated tuition and an experimental phase where you can create your own program and watch its effect on the micro as it runs." 1 '''" There are 3 areas that can hold data :"''" - 1 '''" The first time you try this program, we suggest you go through each of the first two phases repeatedly until you are confident enough to try the experimenter."''''" Once in the experimenter, you can always return to the tutor phases without losing your test program." 1 '''" Registers are special storage locations inside the Z80 chip itself."''" When your program ( in RAM ) is being obeyed ( or the Sinclair operating system program in ROM is running ), then these registers are used to hold the temporary results of your computations - the additions, subtractions, compares and so on.": 1 '''" Please select the phase you want to enter :"'''" 1 '''" In this phase of the Beyond BASIC program, you will be introduced to the concepts behind STORE and REGISTERS."'''" Simple actions that we might like our Spectrum to perform are also met."'''" Gradually the format of these commands moves towards that of Z80 Assembler." 1 '''" After a little practice with this program, you should be quite confident in reading & understanding more complex Z80 Assembler or micro guides."''''" HAVE FUN!": 1 ''"The flag register (F) is an internal register set by certainfunctions according to their result. "''"In particular it reflects the result of subtractions,additionsand comparisons."''"Z (zero) and NZ (non zero) are used to show the result of the last action affecting F.": 1 ''"For example :"''"LD"; 1 ''"An instruction consists of two or more sections, as follows:"'' 1 ''" We can think of our RAM store as being a long row of boxes."'' 1 '"nn on its own means a number between 0 and 64k. "''" This is usually the number of the address of a store box."''" Since you don't know the addresses of your store boxes ( M to Y ), we use ^M to mean 'address of M'": 1 '"(nn) means the contents of store location nn where nn is a number from 0 1 '" The program is made up of three sections."''" In the first, the concepts of ROM & RAM store, registers and simple machine code elements are explained."''" In the second part, a set of Z80 Assembler-like commands are individually described with a 'moving' example."''" Finally, in the experimental phase, you use this Assembler knowledge to create a program and watch its effect on store and registers." 1 '" As the Spectrum has a Z80 processor we use Z80 Assembler to assemble our programs. We shall now go on and find out more about the instructions we can use in our Z80 Assembly Language programs." 1 '" A 16k or 48k SPECTRUM contains chips offering 16k or 48k of RAM store to you."''" RAM store holds your program and data areas - and you can alter these as you wish."''" The contents of RAM are lost when the power is off." 1 "S save","6 down","M menu","7 up",,: 1 "HL,^";r$(b); 1 "HL,(";r$(b);")"; 1 "Beyond BASIC - Experimentor": 1 "A,(";r$(b);")"; 1 "(";r$(b);"),HL"; 1 "(";r$(b);"),A"; 1 " Values can be posted into each box, known as writing to store - POKE in Basic."'' 1 " Values can also be collected from each box, known as reading from store - PEEK in Basic."'' 1 " To identify each box, we give it an address in the form of a number (from 0 to 16 or 48k) or a name. These names and numbers are like postal addresses." 1 " M leave Experimentor" 1 " C continue existing program",, 1 " 1 the value C? 1 storage K 1 numbers W 1 characters M 1 Z80 microprocessorN 1 64k."''" Assemblers usually let you tie a name to an address."''" In this program, we have created 13 data boxes for you. Their addresses needn't worry you."''" Their names are M to Y."''" You can replace (nn) by (M) to (Y) as needed.": 1 ( & ENTER)."; 1 [compare values, etc]" 1 ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~ 1 U 1 1